package com.skiving.cloud.admin.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.StringJoiner;

/**
 * 系统日志 实体类。
 *
 * @author skivingcloud
 * @since 2023-12-06
 */
@Table(value = "sys_log")
public class SysLog implements Serializable {

    @Id
    private String id;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 用户操作模块
     */
    private String module;

    /**
     * 请求方法
     */
    private String methods;

    /**
     * 执行时长(毫秒)
     */
    private String actionTime;

    /**
     * IP地址
     */
    private String userIp;

    /**
     * 操作时间
     */
    private LocalDateTime operTime;

    /**
     * 描述
     */
    private String description;

    /**
     * 业务id
     */
    private String bussid;

    /**
     * 客户端类型：1-PC端、2-手机、3-平板、4-其他设备
     */
    private String clientType;

    /**
     * 移动端唯一标识
     */
    private String mobileUuid;

    /**
     * 功能编号
     */
    private String functionNo;

    /**
     * 是否成功
     */
    private String status;

    /**
     * 错误消息
     */
    private String errorMessage;
    /**
     * 请求参数
     */
    private String operateParams;

    /**
     * 返回结果
     */
    private String result;

    @Column(ignore = true)
    private String staffName;
    @Column(ignore = true)
    private String username;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public String getMethods() {
        return methods;
    }

    public void setMethods(String methods) {
        this.methods = methods;
    }

    public String getActionTime() {
        return actionTime;
    }

    public void setActionTime(String actionTime) {
        this.actionTime = actionTime;
    }

    public String getUserIp() {
        return userIp;
    }

    public void setUserIp(String userIp) {
        this.userIp = userIp;
    }

    public LocalDateTime getOperTime() {
        return operTime;
    }

    public void setOperTime(LocalDateTime operTime) {
        this.operTime = operTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getBussid() {
        return bussid;
    }

    public void setBussid(String bussid) {
        this.bussid = bussid;
    }

    public String getClientType() {
        return clientType;
    }

    public void setClientType(String clientType) {
        this.clientType = clientType;
    }

    public String getMobileUuid() {
        return mobileUuid;
    }

    public void setMobileUuid(String mobileUuid) {
        this.mobileUuid = mobileUuid;
    }

    public String getFunctionNo() {
        return functionNo;
    }

    public void setFunctionNo(String functionNo) {
        this.functionNo = functionNo;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getStaffName() {
        return staffName;
    }

    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getOperateParams() {
        return operateParams;
    }

    public void setOperateParams(String operateParams) {
        this.operateParams = operateParams;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", SysLog.class.getSimpleName() + "[", "]")
                .add("id='" + id + "'")
                .add("userId='" + userId + "'")
                .add("module='" + module + "'")
                .add("methods='" + methods + "'")
                .add("actionTime='" + actionTime + "'")
                .add("userIp='" + userIp + "'")
                .add("operTime=" + operTime)
                .add("description='" + description + "'")
                .add("bussid='" + bussid + "'")
                .add("clientType='" + clientType + "'")
                .add("mobileUuid='" + mobileUuid + "'")
                .add("functionNo='" + functionNo + "'")
                .add("status='" + status + "'")
                .add("errorMessage='" + errorMessage + "'")
                .add("operateParams='" + operateParams + "'")
                .add("result='" + result + "'")
                .toString();
    }
}
